class_name CardMenuUI
extends CenterContainer

signal tooltip_requested(card: Card)

@export var card: Card: set = _set_card

@onready var visuals: CardVisuals = %Visuals


func _set_card(value: Card) -> void:
	if not is_node_ready():
		await ready
	card = value
	visuals.card = card

func _on_visuals_gui_input(event: InputEvent) -> void:
	if event.is_action_pressed("left_mouse"):
		tooltip_requested.emit(card)


func _on_visuals_mouse_entered() -> void:
	visuals.panel.add_theme_stylebox_override("panel", AutoLoader.HOVER_STYLEBOX)


func _on_visuals_mouse_exited() -> void:
	visuals.panel.add_theme_stylebox_override("panel", AutoLoader.BASE_STYLEBOX)
